#pragma once
#include "LockedObstacle.h"

class Door : public LockedObstacle {
protected:
	bool m_open;
public:
	Door(LockType lockType = LT_NONE, bool locked = false);
	Door(std::ifstream& file);
	~Door();
	bool isOpen() const;
	static Door* getDoor();
	void render(float x, float y);
	void logDetails(TextLog& log) const;
	void open();
	void close();
	bool toggleLock();
	std::string getName() const;
	void save(std::ofstream& file) const;
};

inline bool Door::isOpen() const {return m_open;}
inline void Door::open() {m_blocking = m_open = true; m_blocking = false;}
inline void Door::close() {m_open = false; m_blocking = true;}